package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.exceptionResolver.ExceptionMessage;
import com.itheima.service.AccessLogService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/accessLog")
public class AccessLogController {
    @Reference
    AccessLogService accessLogService;
    @RequestMapping("/findPage")
    @ExceptionMessage(value = MessageConstant.GET_ACCESSLOG_FALL)
    public Result findPage(@RequestBody QueryPageBean queryPageBean){
        PageResult page = accessLogService.findPage(queryPageBean);
        return new Result(true,MessageConstant.GET_ACCESSLOG_SUCCESS,page );
    }
}
